package com.zyz.K_集合.List接口实现类三Vector;

import java.util.Iterator;
import java.util.Vector;

/**
 * @author: vick
 * @Date: 2025/3/28
 * @Description:
 * @version: 1.0
 */
public class Demo1 {
    public static void main(String[] args) {
        Vector<String> vector = new Vector();
        vector.add("aaa");
        vector.add("bbb");
        vector.add("ccc");
        vector.add("ddd");

        System.out.println(vector);

        vector.set(1, "ooo");
        System.out.println(vector);

        Iterator<String> iterator = vector.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

        System.out.println("=====");
        for (String s : vector) {
            System.out.println(s);
        }
    }
}
